#ifndef _MOTION_FB_DEF_H_
#define _MOTION_FB_DEF_H_

#include "iec_types_all.h"
#include "accessor.h"

typedef unsigned char uint8_t;
//typedef unsigned int uint32_t;

typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(BOOL, TRIG)
    __DECLARE_VAR(STRING, CODE)
    __DECLARE_VAR(BOOL, ACK)
    __DECLARE_VAR(STRING, RESULT)
    __DECLARE_VAR(DWORD, STATE)
    __DECLARE_VAR(STRING, BUFFER)
    __DECLARE_VAR(STRING, PREBUFFER)
    __DECLARE_VAR(BOOL, TRIGM1)
    __DECLARE_VAR(BOOL, TRIGGED)
} PYTHON_EVAL;

// FUNCTION_BLOCK python_poll
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(BOOL, TRIG)
    __DECLARE_VAR(STRING, CODE)
    __DECLARE_VAR(BOOL, ACK)
    __DECLARE_VAR(STRING, RESULT)
    __DECLARE_VAR(DWORD, STATE)
    __DECLARE_VAR(STRING, BUFFER)
    __DECLARE_VAR(STRING, PREBUFFER)
    __DECLARE_VAR(BOOL, TRIGM1)
    __DECLARE_VAR(BOOL, TRIGGED)
} PYTHON_POLL;

// FUNCTION_BLOCK python_gear
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(USINT, N)
    __DECLARE_VAR(BOOL, TRIG)
    __DECLARE_VAR(STRING, CODE)
    __DECLARE_VAR(BOOL, ACK)
    __DECLARE_VAR(STRING, RESULT)
    PYTHON_EVAL PY_EVAL;
    __DECLARE_VAR(USINT, COUNTER)
} PYTHON_GEAR;
__DECLARE_DERIVED_TYPE(MC_CAMSWITCH_REF, INT)
__DECLARE_DERIVED_TYPE(OUTPUT_REF, INT)
__DECLARE_DERIVED_TYPE(MC_TRACK_REF, INT)
__DECLARE_DERIVED_TYPE(MC_TRIGGER_REF, INT)
__DECLARE_DERIVED_TYPE(MC_CAM_REF, INT)
__DECLARE_DERIVED_TYPE(MC_CAM_ID, INT)
__DECLARE_DERIVED_TYPE(MC_START_MODE, INT)
__DECLARE_DERIVED_TYPE(MC_SYNC_MODE, INT)

__DECLARE_DERIVED_TYPE(AXIS_REF, INT)
__DECLARE_DERIVED_TYPE(MC_TP_REF, INT)
__DECLARE_DERIVED_TYPE(MC_TV_REF, INT)
__DECLARE_DERIVED_TYPE(MC_TA_REF, INT)
__DECLARE_DERIVED_TYPE(MC_TRIGGER_REF, INT)
__DECLARE_DERIVED_TYPE(MC_START_MODE, INT)
__DECLARE_ENUMERATED_TYPE(MC_COMBINE_MODE,
                          MC_COMBINE_MODE__MCADDAXES,
                          MC_COMBINE_MODE__MCSUBAXES
)
__DECLARE_ARRAY_TYPE(MC_REAL_ARRAY, REAL, [6])

__DECLARE_ENUMERATED_TYPE(MC_HOMING_PROCEDURES,
                          MC_HOMING_PROCEDURES__MCHOMEDIRECT,
                          MC_HOMING_PROCEDURES__MCHOMELIMITSWITCHPOSITIVE,
                          MC_HOMING_PROCEDURES__MCHOMELIMITSWITCHNEGATIVE,
                          MC_HOMING_PROCEDURES__MCHOMEABSOLUTESWITCHPOSITIVE,
                          MC_HOMING_PROCEDURES__MCHOMEABSOLUTESWITCHNEGATIVE,
                          MC_HOMING_PROCEDURES__MCHOMEREFERENCEPULSEPOSITIVE,
                          MC_HOMING_PROCEDURES__MCHOMEREFERENCEPULSENEGATIVE,
                          MC_HOMING_PROCEDURES__MCHOMEABSOLUTE
)
__DECLARE_ENUMERATED_TYPE(MC_BUFFER_MODE,
                          MC_BUFFER_MODE__MCABORTING,
                          MC_BUFFER_MODE__MCBUFFERED,
                          MC_BUFFER_MODE__MCBLENDINGLOW,
                          MC_BUFFER_MODE__MCBLENDINGPREVIOUS,
                          MC_BUFFER_MODE__MCBLENDINGNEXT,
                          MC_BUFFER_MODE__MCBLENDINGHIGH
)
__DECLARE_ENUMERATED_TYPE(MC_DIRECTION,
                          MC_DIRECTION__MCABSOLUTEPOSITION,
                          MC_DIRECTION__MCPOSITIVEDIRECTION,
                          MC_DIRECTION__MCSHORTESTWAY,
                          MC_DIRECTION__MCNEGATIVEDIRECTION,
                          MC_DIRECTION__MCCURRENTDIRECTION
)
__DECLARE_ENUMERATED_TYPE(MC_EXECUTION_MODE,
                          MC_EXECUTION_MODE__MCIMMEDIATELY,
                          MC_EXECUTION_MODE__MCQUEUED
)
__DECLARE_ENUMERATED_TYPE(MC_SOURCE,
                          MC_SOURCE__MCACTUALVALUE,
                          MC_SOURCE__MCSETVALUE
)

__DECLARE_DERIVED_TYPE(MC_PATH_DATA_REF, INT)
__DECLARE_DERIVED_TYPE(MC_PATH_REF, INT)
__DECLARE_ENUMERATED_TYPE(MC_PATH_MODE,
                          MC_PATH_MODE__MCNONPERIODIC,
                          MC_PATH_MODE__MCPERIODIC
)
__DECLARE_ARRAY_TYPE(MC_INT_ARRAY, INT, [6])
///***************************************///
// FUNCTION_BLOCK MC_Power
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(BOOL, ENABLEPOSITIVE)
    __DECLARE_VAR(BOOL, ENABLENEGATIVE)
    __DECLARE_VAR(BOOL, STATUS)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
} MC_POWER;

// FUNCTION_BLOCK MC_Home
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(REAL, POSITION)
    __DECLARE_VAR(MC_HOMING_PROCEDURES, HOMINGMODE)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_HOME;

// FUNCTION_BLOCK MC_Stop
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_STOP;

// FUNCTION_BLOCK MC_Halt
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_HALT;

// FUNCTION_BLOCK MC_MoveAbsolute
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, POSITION)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_DIRECTION, DIRECTION)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_MOVEABSOLUTE;

// FUNCTION_BLOCK MC_MoveRelative
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, DISTANCE)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_MOVERELATIVE;

// FUNCTION_BLOCK MC_MoveAdditive
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, DISTANCE)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_MOVEADDITIVE;

// FUNCTION_BLOCK MC_ReadParameter
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(INT, PARAMETERNUMBER)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, VALUE)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READPARAMETER;

// FUNCTION_BLOCK MC_ReadBoolParameter
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(INT, PARAMETERNUMBER)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, VALUE)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READBOOLPARAMETER;

// FUNCTION_BLOCK MC_WriteParameter
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(INT, PARAMETERNUMBER)
    __DECLARE_VAR(REAL, VALUE)
    __DECLARE_VAR(MC_EXECUTION_MODE, EXECUTIONMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_WRITEPARAMETER;

// FUNCTION_BLOCK MC_WriteBoolParameter
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(INT, PARAMETERNUMBER)
    __DECLARE_VAR(BOOL, VALUE)
    __DECLARE_VAR(MC_EXECUTION_MODE, EXECUTIONMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_WRITEBOOLPARAMETER;

// FUNCTION_BLOCK MC_ReadStatus
// Data part
#undef DISABLED
#undef ENABLED
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, ERRORSTOP)
    __DECLARE_VAR(BOOL, DISABLED)
    __DECLARE_VAR(BOOL, STOPPING)
    __DECLARE_VAR(BOOL, HOMING)
    __DECLARE_VAR(BOOL, STANDSTILL)
    __DECLARE_VAR(BOOL, DISCRETEMOTION)
    __DECLARE_VAR(BOOL, CONTINUOUSMOTION)
    __DECLARE_VAR(BOOL, SYNCHRONIZEDMOTION)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READSTATUS;

// FUNCTION_BLOCK MC_ReadAxisInfo
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, HOMEABSSWITCH)
    __DECLARE_VAR(BOOL, LIMITSWITCHPOS)
    __DECLARE_VAR(BOOL, LIMITSWITCHNEG)
    __DECLARE_VAR(BOOL, SIMULATION)
    __DECLARE_VAR(BOOL, COMMUNICATIONREADY)
    __DECLARE_VAR(BOOL, READYFORPOWERON)
    __DECLARE_VAR(BOOL, POWERON)
    __DECLARE_VAR(BOOL, ISHOMED)
    __DECLARE_VAR(BOOL, AXISWARNING)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READAXISINFO;

// FUNCTION_BLOCK MC_ReadAxisError
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(WORD, AXISERRORID)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READAXISERROR;

// FUNCTION_BLOCK MC_Reset
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_RESET;
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(UINT, TORQUELIMITPOS)
    __DECLARE_VAR(UINT, TORQUELIMITNEG)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_GETTORQUELIMIT;

// FUNCTION_BLOCK MC_SetTorqueLimit
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(UINT, TORQUELIMITPOS)
    __DECLARE_VAR(UINT, TORQUELIMITNEG)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_SETTORQUELIMIT;
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, DISTANCE)
    __DECLARE_VAR(REAL, VELOCITYDIFF)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, COVEREDDISTANCE)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_MOVESUPERIMPOSED;

// FUNCTION_BLOCK MC_HaltSuperimposed
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_HALTSUPERIMPOSED;

// FUNCTION_BLOCK MC_MoveVelocity
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_DIRECTION, DIRECTION)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, INVELOCITY)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INVELOCITY0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_MOVEVELOCITY;

// FUNCTION_BLOCK MC_MoveContinuousAbsolute
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, POSITION)
    __DECLARE_VAR(REAL, ENDVELOCITY)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_DIRECTION, DIRECTION)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, INENDVELOCITY)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INENDVELOCITY0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_MOVECONTINUOUSABSOLUTE;

// FUNCTION_BLOCK MC_MoveContinuousRelative
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, DISTANCE)
    __DECLARE_VAR(REAL, ENDVELOCITY)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, INENDVELOCITY)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INENDVELOCITY0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_MOVECONTINUOUSRELATIVE;

// FUNCTION_BLOCK MC_TorqueControl
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, TORQUE)
    __DECLARE_VAR(REAL, TORQUERAMP)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_DIRECTION, DIRECTION)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, INTORQUE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INTORQUE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_TORQUECONTROL;

// FUNCTION_BLOCK MC_PositionProfile
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(MC_TP_REF, TIMEPOSITION)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, TIMESCALE)
    __DECLARE_VAR(REAL, POSITIONSCALE)
    __DECLARE_VAR(REAL, OFFSET)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_POSITIONPROFILE;

// FUNCTION_BLOCK MC_VelocityProfile
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(MC_TV_REF, TIMEVELOCITY)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, TIMESCALE)
    __DECLARE_VAR(REAL, VELOCITYSCALE)
    __DECLARE_VAR(REAL, OFFSET)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, PROFILECOMPLETED)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, PROFILECOMPLETED0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_VELOCITYPROFILE;

// FUNCTION_BLOCK MC_AccelerationProfile
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(MC_TA_REF, TIMEACCELERATION)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, TIMESCALE)
    __DECLARE_VAR(REAL, ACCELERATIONSCALE)
    __DECLARE_VAR(REAL, OFFSET)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, PROFILECOMPLETED)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, PROFILECOMPLETED0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_ACCELERATIONPROFILE;

// FUNCTION_BLOCK MC_SetPosition
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(REAL, POSITION)
    __DECLARE_VAR(BOOL, RELATIVE)
    __DECLARE_VAR(MC_EXECUTION_MODE, EXECUTIONMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_SETPOSITION;

// FUNCTION_BLOCK MC_SetOverride
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(REAL, VELFACTOR)
    __DECLARE_VAR(REAL, ACCFACTOR)
    __DECLARE_VAR(REAL, JERKFACTOR)
    __DECLARE_VAR(BOOL, ENABLED)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_SETOVERRIDE;

// FUNCTION_BLOCK MC_ReadDigitalInput
// Data part
#undef INPUT
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, INPUT)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(INT, INPUTNUMBER)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, VALUE)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READDIGITALINPUT;
#undef OUTPUT
// FUNCTION_BLOCK MC_ReadDigitalOutput
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, OUTPUT)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(INT, OUTPUTNUMBER)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, VALUE)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READDIGITALOUTPUT;

// FUNCTION_BLOCK MC_WriteDigitalOutput
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, OUTPUT)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(INT, OUTPUTNUMBER)
    __DECLARE_VAR(BOOL, VALUE)
    __DECLARE_VAR(MC_EXECUTION_MODE, EXECUTIONMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_WRITEDIGITALOUTPUT;

// FUNCTION_BLOCK MC_ReadActualPosition
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, POSITION)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READACTUALPOSITION;

// FUNCTION_BLOCK MC_ReadActualVelocity
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READACTUALVELOCITY;

// FUNCTION_BLOCK MC_ReadActualTorque
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, TORQUE)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READACTUALTORQUE;


// FUNCTION_BLOCK MC_ReadMotionState
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(MC_SOURCE, SOURCE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, CONSTANTVELOCITY)
    __DECLARE_VAR(BOOL, ACCELERATING)
    __DECLARE_VAR(BOOL, DECELERATING)
    __DECLARE_VAR(BOOL, DIRECTIONPOSITIVE)
    __DECLARE_VAR(BOOL, DIRECTIONNEGATIVE)
    __DECLARE_VAR(BOOL, ENABLE0)
} MC_READMOTIONSTATE;


// FUNCTION_BLOCK MC_DigitalCamSwitch
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(MC_CAMSWITCH_REF, SWITCHES)
    __DECLARE_VAR(OUTPUT_REF, OUTPUTS)
    __DECLARE_VAR(MC_TRACK_REF, TRACKOPTIONS)
    __DECLARE_VAR(BOOL, ENABLE)
    __DECLARE_VAR(DWORD, ENABLEMASK)
    __DECLARE_VAR(MC_SOURCE, VALUESOURCE)
    __DECLARE_VAR(BOOL, INOPERATION)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, ENABLE0)
    __DECLARE_VAR(BOOL, INOPERATION0)
} MC_DIGITALCAMSWITCH;

// FUNCTION_BLOCK MC_TouchProbe
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(MC_TRIGGER_REF, TRIGGERINPUT)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, WINDOWONLY)
    __DECLARE_VAR(REAL, FIRSTPOSITION)
    __DECLARE_VAR(REAL, LASTPOSITION)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, RECORDEDPOSITION)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_TOUCHPROBE;

// FUNCTION_BLOCK MC_AbortTrigger
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, AXIS)
    __DECLARE_VAR(MC_TRIGGER_REF, TRIGGERINPUT)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_ABORTTRIGGER;

// FUNCTION_BLOCK MC_CamTableSelect
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, MASTER)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(MC_CAM_REF, CAMTABLE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, PERIODIC)
    __DECLARE_VAR(BOOL, MASTERABSOLUTE)
    __DECLARE_VAR(BOOL, SLAVEABSOLUTE)
    __DECLARE_VAR(MC_EXECUTION_MODE, EXECUTIONMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(MC_CAM_ID, CAMTABLEID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, REFINIT)
    __DECLARE_VAR(MC_CAM_ID, CAMTABLEIDREF)
} MC_CAMTABLESELECT;

// FUNCTION_BLOCK MC_CamIn
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, MASTER)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(REAL, MASTEROFFSET)
    __DECLARE_VAR(REAL, SLAVEOFFSET)
    __DECLARE_VAR(REAL, MASTERSCALING)
    __DECLARE_VAR(REAL, SLAVESCALING)
    __DECLARE_VAR(REAL, MASTERSTARTDISTANCE)
    __DECLARE_VAR(REAL, MASTERSYNCPOSITION)
    __DECLARE_VAR(MC_START_MODE, STARTMODE)
    __DECLARE_VAR(MC_SOURCE, MASTERVALUESOURCE)
    __DECLARE_VAR(MC_CAM_ID, CAMTABLEID)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, INSYNC)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, ENDOFPROFILE)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INSYNC0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_CAMIN;

// FUNCTION_BLOCK MC_CamOut
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_CAMOUT;

// FUNCTION_BLOCK MC_GearIn
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, MASTER)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(INT, RATIONUMERATOR)
    __DECLARE_VAR(UINT, RATIODENOMINATOR)
    __DECLARE_VAR(MC_SOURCE, MASTERVALUESOURCE)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, INGEAR)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INGEAR0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_GEARIN;

// FUNCTION_BLOCK MC_GearOut
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
} MC_GEAROUT;

// FUNCTION_BLOCK MC_GearInPos
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, MASTER)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(INT, RATIONUMERATOR)
    __DECLARE_VAR(UINT, RATIODENOMINATOR)
    __DECLARE_VAR(MC_SOURCE, MASTERVALUESOURCE)
    __DECLARE_VAR(REAL, MASTERSYNCPOSITION)
    __DECLARE_VAR(REAL, SLAVESYNCPOSITION)
    __DECLARE_VAR(MC_SYNC_MODE, SYNCMODE)
    __DECLARE_VAR(REAL, MASTERSTARTDISTANCE)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, STARTSYNC)
    __DECLARE_VAR(BOOL, INSYNC)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INSYNC0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_GEARINPOS;

// FUNCTION_BLOCK MC_PhasingAbsolute
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, MASTER)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(REAL, PHASESHIFT)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, ABSOLUTEPHASESHIFT)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_PHASINGABSOLUTE;

// FUNCTION_BLOCK MC_PhasingRelative
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, MASTER)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(REAL, PHASESHIFT)
    __DECLARE_VAR(REAL, VELOCITY)
    __DECLARE_VAR(REAL, ACCELERATION)
    __DECLARE_VAR(REAL, DECELERATION)
    __DECLARE_VAR(REAL, JERK)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, DONE)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(REAL, COVEREDPHASESHIFT)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, DONE0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_PHASINGRELATIVE;

// FUNCTION_BLOCK MC_CombineAxes
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(AXIS_REF, MASTER1)
    __DECLARE_VAR(AXIS_REF, MASTER2)
    __DECLARE_VAR(AXIS_REF, SLAVE)
    __DECLARE_VAR(BOOL, EXECUTE)
    __DECLARE_VAR(BOOL, CONTINUOUSUPDATE)
    __DECLARE_VAR(MC_COMBINE_MODE, COMBINEMODE)
    __DECLARE_VAR(INT, GEARRATIONUMERATORM1)
    __DECLARE_VAR(INT, GEARRATIODENOMINATORM1)
    __DECLARE_VAR(INT, GEARRATIONUMERATORM2)
    __DECLARE_VAR(INT, GEARRATIODENOMINATORM2)
    __DECLARE_VAR(MC_SOURCE, MASTERVALUESOURCEM1)
    __DECLARE_VAR(MC_SOURCE, MASTERVALUESOURCEM2)
    __DECLARE_VAR(MC_BUFFER_MODE, BUFFERMODE)
    __DECLARE_VAR(BOOL, INSYNC)
    __DECLARE_VAR(BOOL, BUSY)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, COMMANDABORTED)
    __DECLARE_VAR(BOOL, ERROR)
    __DECLARE_VAR(WORD, ERRORID)
    __DECLARE_VAR(BOOL, EXECUTE0)
    __DECLARE_VAR(BOOL, INSYNC0)
    __DECLARE_VAR(BOOL, ACTIVE0)
} MC_COMBINEAXES;

// FUNCTION_BLOCK MC_Sim
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(REAL, MAXVEL)
    __DECLARE_VAR(REAL, MAXACC)
    __DECLARE_VAR(REAL, MAXDEC)
    __DECLARE_VAR(AXIS_REF, AXIS)
    MC_WRITEBOOLPARAMETER SIMPARAM;
    MC_WRITEPARAMETER VELPARAM;
    MC_WRITEPARAMETER ACCPARAM;
    MC_WRITEPARAMETER DECPARAM;
    __DECLARE_VAR(BOOL, DONE)
} MC_SIM;

// FUNCTION_BLOCK MC_CreateTrigger
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(BOOL, POSITIVEEDGE)
    __DECLARE_VAR(BOOL, NEGATIVEEDGE)
    __DECLARE_VAR(MC_TRIGGER_REF, TRIGGERINPUT)
    __DECLARE_VAR(BOOL, DONE)
} MC_CREATETRIGGER;

// FUNCTION_BLOCK MC_CreateOutput
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(OUTPUT_REF, OUTPUT)
    __DECLARE_VAR(BOOL, DONE)
} MC_CREATEOUTPUT;

// FUNCTION_BLOCK MC_ToIntArray
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(MC_INT_ARRAY, INTARRAY)
    __DECLARE_VAR(INT, X)
    __DECLARE_VAR(INT, Y)
    __DECLARE_VAR(INT, Z)
    __DECLARE_VAR(INT, U)
    __DECLARE_VAR(INT, V)
    __DECLARE_VAR(INT, W)
} MC_TOINTARRAY;

// FUNCTION_BLOCK MC_ReadOutputBits
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(DWORD, BITS)
    __DECLARE_VAR(OUTPUT_REF, OUTPUT)
} MC_READOUTPUTBITS;

// FUNCTION_BLOCK MC_ReadOutputBit
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(BOOL, BIT)
    __DECLARE_VAR(OUTPUT_REF, OUTPUT)
    __DECLARE_VAR(INT, OUTPUTNUMBER)
} MC_READOUTPUTBIT;

// FUNCTION_BLOCK MC_CreatePathDescription
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(MC_PATH_REF, PATHDESCRIPTION)
    __DECLARE_VAR(BOOL, DONE)
} MC_CREATEPATHDESCRIPTION;

// FUNCTION_BLOCK MC_TP_REF_FROM_CSV
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(STRING, FILENAME)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(MC_TP_REF, TIMEPROFILE)
    PYTHON_EVAL PY1;
} MC_TP_REF_FROM_CSV;

// FUNCTION_BLOCK MC_TV_REF_FROM_CSV
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(STRING, FILENAME)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(MC_TV_REF, TIMEPROFILE)
    PYTHON_EVAL PY1;
} MC_TV_REF_FROM_CSV;

// FUNCTION_BLOCK MC_TA_REF_FROM_CSV
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(STRING, FILENAME)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(MC_TA_REF, TIMEPROFILE)
    PYTHON_EVAL PY1;
} MC_TA_REF_FROM_CSV;

// FUNCTION_BLOCK MC_CAMSWITCH_REF_FROM_CSV
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(STRING, FILENAME)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(MC_CAMSWITCH_REF, CAMSWITCHLIST)
    PYTHON_EVAL PY1;
} MC_CAMSWITCH_REF_FROM_CSV;

// FUNCTION_BLOCK MC_CAM_REF_FROM_CSV
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(STRING, FILENAME)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(MC_CAM_REF, CAMTABLE)
    PYTHON_EVAL PY1;
} MC_CAM_REF_FROM_CSV;

// FUNCTION_BLOCK MC_PATH_DATA_REF_FROM_CSV
// Data part
typedef struct {
    __DECLARE_VAR(BOOL, EN)
    __DECLARE_VAR(BOOL, ENO)
    __DECLARE_VAR(STRING, FILENAME)
    __DECLARE_VAR(BOOL, ACTIVE)
    __DECLARE_VAR(BOOL, VALID)
    __DECLARE_VAR(MC_PATH_DATA_REF, PATHDATA)
    PYTHON_EVAL PY1;
} MC_PATH_DATA_REF_FROM_CSV;

//#endif

#ifdef __cplusplus
extern "C" {
#endif

///***************************************///
void __mcl_cmd_MC_Power(MC_POWER *data__);

void __mcl_cmd_MC_Home(MC_HOME *data__);

void __mcl_cmd_MC_Stop(MC_STOP *data__);

void __mcl_cmd_MC_Halt(MC_HALT *data__);

void __mcl_cmd_MC_MoveAbsolute(MC_MOVEABSOLUTE *data__);

void __mcl_cmd_MC_MoveRelative(MC_MOVERELATIVE *data__);

void __mcl_cmd_MC_MoveAdditive(MC_MOVEADDITIVE *data__);

void __mcl_cmd_MC_ReadParameter(MC_READPARAMETER *data__);

void __mcl_cmd_MC_ReadBoolParameter(MC_READBOOLPARAMETER *data__);

void __mcl_cmd_MC_WriteParameter(MC_WRITEPARAMETER *data__);

void __mcl_cmd_MC_WriteBoolParameter(MC_WRITEBOOLPARAMETER *data__);

void __mcl_cmd_MC_ReadStatus(MC_READSTATUS *data__);

void __mcl_cmd_MC_ReadAxisInfo(MC_READAXISINFO *data__);

void __mcl_cmd_MC_ReadAxisError(MC_READAXISERROR *data__);

void __mcl_cmd_MC_Reset(MC_RESET *data__);

int __MK_Alloc_MC_CAM_REF();

extern uint8_t __MK_CheckPublic_MC_CAMSWITCH_REF(int);

extern int __MK_Alloc_MC_CAMSWITCH_REF();

extern uint8_t __MK_CheckPublic_MC_TA_REF(int);

extern int __MK_Alloc_MC_TA_REF();

extern uint8_t __MK_CheckPublic_MC_TV_REF(int);

extern int __MK_Alloc_MC_TV_REF();

extern uint8_t __MK_CheckPublic_MC_TP_REF(int);

extern int __MK_Alloc_MC_TP_REF();

extern uint32_t *__MK_GetPublic_MC_OUTPUT_REF(int);

extern int __MK_Alloc_MC_OUTPUT_REF();

uint8_t *__MK_GetPublic_MC_TRIGGER_REF(int index);

int __MK_Alloc_MC_TRIGGER_REF();

extern int __MK_Alloc_MC_CAM_ID();

extern uint8_t __MK_CheckPublic_MC_CAM_REF(int);

extern void __mcl_cmd_MC_CombineAxes(MC_COMBINEAXES *);

extern void __mcl_cmd_MC_PhasingRelative(MC_PHASINGRELATIVE *);

extern void __mcl_cmd_MC_PhasingAbsolute(MC_PHASINGABSOLUTE *);

extern void __mcl_cmd_MC_GearInPos(MC_GEARINPOS *);

extern void __mcl_cmd_MC_GearOut(MC_GEAROUT *);

extern void __mcl_cmd_MC_GearIn(MC_GEARIN *);

extern void __mcl_cmd_MC_CamOut(MC_CAMOUT *);

extern void __mcl_cmd_MC_CamIn(MC_CAMIN *);

extern void __mcl_cmd_MC_CamTableSelect(MC_CAMTABLESELECT *);

extern void __mcl_cmd_MC_AbortTrigger(MC_ABORTTRIGGER *);

extern void __mcl_cmd_MC_TouchProbe(MC_TOUCHPROBE *);

extern void __mcl_cmd_MC_DigitalCamSwitch(MC_DIGITALCAMSWITCH *);

extern void __mcl_cmd_MC_ReadMotionState(MC_READMOTIONSTATE *);

extern void __mcl_cmd_MC_ReadActualTorque(MC_READACTUALTORQUE *);

extern void __mcl_cmd_MC_ReadActualVelocity(MC_READACTUALVELOCITY *);

extern void __mcl_cmd_MC_ReadActualPosition(MC_READACTUALPOSITION *);

extern void __mcl_cmd_MC_WriteDigitalOutput(MC_WRITEDIGITALOUTPUT *);

extern void __mcl_cmd_MC_ReadDigitalOutput(MC_READDIGITALOUTPUT *);

extern void __mcl_cmd_MC_ReadDigitalInput(MC_READDIGITALINPUT *);

extern void __mcl_cmd_MC_SetOverride(MC_SETOVERRIDE *);

extern void __mcl_cmd_MC_SetPosition(MC_SETPOSITION *);

extern void __mcl_cmd_MC_AccelerationProfile(MC_ACCELERATIONPROFILE *);

extern void __mcl_cmd_MC_VelocityProfile(MC_VELOCITYPROFILE *);

extern void __mcl_cmd_MC_PositionProfile(MC_POSITIONPROFILE *);

extern void __mcl_cmd_MC_TorqueControl(MC_TORQUECONTROL *);

extern void __mcl_cmd_MC_MoveContinuousRelative(MC_MOVECONTINUOUSRELATIVE *);

extern void __mcl_cmd_MC_MoveContinuousAbsolute(MC_MOVECONTINUOUSABSOLUTE *);

extern void __mcl_cmd_MC_MoveVelocity(MC_MOVEVELOCITY *);

extern void __mcl_cmd_MC_HaltSuperimposed(MC_HALTSUPERIMPOSED *);

extern void __mcl_cmd_MC_MoveSuperimposed(MC_MOVESUPERIMPOSED *);

extern void __mcl_cmd_MC_SetTorqueLimit(MC_SETTORQUELIMIT *);

extern void __mcl_cmd_MC_GetTorqueLimit(MC_GETTORQUELIMIT *);

int __MK_Alloc_MC_CAM_REF();

int MK_Load_MC_TP_REF_CSV(int val);

int MK_Load_MC_TV_REF_CSV(int val);

int MK_Load_MC_TA_REF_CSV(int val);

int MK_Load_MC_CAMSWITCH_REF_CSV(int val);

int MK_Load_MC_CAM_REF_CSV(int val);
#ifdef __cplusplus
}
#endif
#endif
//Eof
